package com.loongtech.bi.entity.system;

import com.loongtech.core.gen.GenInnerK;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

@Entity
@Table(name = "system_function")
@GenInnerK
public class EntitySysFunction implements Serializable {
	private static final long serialVersionUID = 1L;
    @Id
    private Integer id;				//主键
	@Column(columnDefinition="varchar(255) NOT NULL default ''")
	private String src;	 // 功能地址
	@Column(columnDefinition="varchar(255) default ''")
	private String target;
	@Column(columnDefinition="varchar(255) NOT NULL default ''")
	private String name;						// 功能名称
	@Column(columnDefinition="int(11) NOT NULL default 0")
	private int modelId;					// 所属模块
	@Column(columnDefinition="int(11) default 0")
	private int sort;						// 功能排序
	@Column(columnDefinition="int(11) default 0")
	private int status;					// 功能状态
	@Column(columnDefinition="varchar(255)")
	private String description;

    private int version = 1;			//乐观锁

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

	public String getSrc() {
		return src;
	}

	public void setSrc(String src) {
		this.src = src;
	}

	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getModelId() {
		return modelId;
	}

	public void setModelId(int modelId) {
		this.modelId = modelId;
	}

	public int getSort() {
		return sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}


    @Override
    public String toString() {
        return "EntitySysFunction{" +
                "id=" + id +
                ", src='" + src + '\'' +
                ", target='" + target + '\'' +
                ", name='" + name + '\'' +
                ", modelId=" + modelId +
                ", sort=" + sort +
                ", status=" + status +
                ", description='" + description +
                '}';
    }

    public static class K {
		public static final String src = "src";
		public static final String target = "target";
		public static final String name = "name";
		public static final String modelId = "modelId";
		public static final String sort = "sort";
		public static final String status = "status";
		public static final String description = "description";
		public static final String id = "id";
		public static final String version = "version";
		
		//src, target, name, modelId, sort, status, description, id, version, 
		public static java.util.List<String> toList() {
			java.util.List<String> list = new java.util.ArrayList<>();
			list.add(src);
			list.add(target);
			list.add(name);
			list.add(modelId);
			list.add(sort);
			list.add(status);
			list.add(description);
			list.add(id);
			list.add(version);
			return list;
		}
	}
}